package day07.ThreadDemo;

/*
 * Author: JacksonCoder
 * FileName: ExecutorsExmple
 * Version: 1.0.0
 * Date: 2025/4/14
 */

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ExecutorsExample {
    //使用 Executors 创建线程池 + 提交 Runnable
    public static void main(String[] args) {
        ExecutorService executor = Executors.newFixedThreadPool(2);
        executor.submit(() -> System.out.println("Task running in thread pool"));
        executor.shutdown(); // 关闭线程池
    }

}
